#pragma once
#include "../../utility/thread.h"
#include "../../../include/loopbuffer.hpp"

#define MAX_LOG_CACHE       512*1024

class CLogThread :
    public CThread
{
public:
    CLogThread(void);
    ~CLogThread(void);

    bool Start(void);
    void Stop(void);
    virtual void ThreadProc(void);

    bool PushLogData(char* data, int size);

protected:
    CLoopBuffer<char>   m_log_data_cache;
    bool                m_run;
    char                m_log_buf[MAX_LOG_CACHE];
};
